﻿<%@ WebHandler Language="C#" Class="IncreaseHandler" %>

using System;
using System.Web;

public class IncreaseHandler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";

        string fullPath = context.Server.MapPath("Index.htm");
        string content = System.IO.File.ReadAllText(fullPath);

        string IsPostBack = context.Request["IsPostBack"];
        int num = 0;
        if (IsPostBack == "true")
        {
            num = Convert.ToInt32(context.Request["txtNum"]) + 1;
        }
       
        content = content.Replace("@Num", num.ToString());
        context.Response.Write(content);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}